home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-15 | 2.2 KB | 93 lines | [TEXT/MPS ] |
- // Copyright © 1992 Apple Computer, Inc. All rights reserved.
- // UAppFrameAdorner.cp
- // Kent Sandvik DTS
- // This file is used for specifying the TAppFrameAdorner member functions,
- // Version Info (latest first):
- //
- // <1> khs 1.0 First final version
- // <2> khs 1.0.1 Fixed a memory leak in TMapApplication::GetSleepValue()
-
-
-
- #ifndef __APPFRAMEADORNER__
- #include "UAppFrameAdorner.h"
- #endif
-
-
- // Empty constructor - for avoiding ptabs in global data space
- #pragma segment ARes
- TAppFrameAdorner::TAppFrameAdorner()
- {
- }
-
-
- // Draw TAppFrameAdorner Adorner method
- #pragma segment ARes
- pascal void TAppFrameAdorner::Draw(TView* itsView,
- const VRect& /*area*/)
- {
- CRGBColor saveColor;
- VRect adornArea;
- CRect QDArea;
- CRect tempRect;
- CRGBColor anRGBGray;
- RgnHandle outerRgn;
- RgnHandle innerRgn;
-
-
- PenNormal();
-
- itsView->GetAdornExtent(adornArea);
- itsView->ViewToQDRect(adornArea, QDArea);
- tempRect = QDArea;
-
- // Build the region to use for filling, first create the outer region
- InsetRect(QDArea, 1, 1);
- outerRgn = NewRgn();
- RectRgn(outerRgn, QDArea);
-
- // Create the inner region
- InsetRect(QDArea, 6, 6);
- innerRgn = NewRgn();
- RectRgn(innerRgn, QDArea);
-
- // Finally subtract the inner from the outer region
- DiffRgn(outerRgn, innerRgn, outerRgn);
-
- // Get rid of the inner region
- DisposeRgn(innerRgn);
-
- // Set the foreground color to the global face color, this allows the user to
- // change the color of the face
- SetIfColor(gRGBLtGray);
- PaintRgn(outerRgn);
-
- // Get rid of the outer region
- DisposeRgn(outerRgn);
-
- // Draw the inside black frame
- SetIfColor(gRGBBlack);
- InsetRect(QDArea, 1, 1);
- FrameRect(QDArea);
-
- // Draw the shadows
- {
- // Draw the outer gray shadow
- SetIfColor(gRGBGray);
- MoveTo(tempRect.left + 1, tempRect.bottom - 1);//(h, v)
- LineTo(tempRect.right - 1, tempRect.bottom - 1);//(h, v)
- LineTo(tempRect.right - 1, tempRect.top + 1);//(h, v)
-
- // Draw the inner gray shadow
- SetIfColor(gRGBGray);
- MoveTo(tempRect.left + 7, tempRect.bottom - 8);//(h, v)
- LineTo(tempRect.left + 7, tempRect.top + 7);//(h, v)
- LineTo(tempRect.right - 8, tempRect.top + 7);//(h, v)
- }
-
- // Restore the drawing environment
- itsView->SetupDrawingEnvironment();
- }
-
-
-